
class Events {
    constructor() {
        this.callbacks = []
        this.results = []
    }
    on(callback) {
        this.callbacks.push(callback)

    }
    emit(data) {
        this.results.push(data)
        this.callbacks.forEach(call => call(this.results))
    }

}
let e = new Events()
e.on(function (arr) {
    if (arr === condation) {
        console.log(arr);
    }

})
e.on(function (arr) {
    if (arr === condation) {
        console.log(arr);
    }

})
e.on(function (arr) {
    if (arr === condation) {
        console.log(arr);
    }

})
e.emit(data)
e.emit(data)

